package com.sz.controller;

import com.sz.pojo.User;
import com.sz.service.RevExpSVImpl;
import com.sz.service.UserSVImpl;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.annotation.Resource;

@Controller
@RequestMapping("/delete")
public class DeleteController {
    @Resource
    private RevExpSVImpl revExpSV;
    @Resource
    private UserSVImpl userSV;

    @RequestMapping("/id2")
    public String deleteRevexpById2(int id){
        int i = revExpSV.deleteById(id);
        return "redirect:/query/all2";
    }

    @RequestMapping("/id0")
    public String deleteRevexpById0(int id){
        int i = revExpSV.deleteById(id);
        return "redirect:/query/all0";
    }

    @RequestMapping("/user")
    public String deleteOneById(User user){
        int i = userSV.deleteOneById(user);
        return "forward:/toIndex3";
    }
}
